//
//  YQStatusCellBottomView.m
//  WeiboOC
//
//  Created by yang on 15/11/20.
//  Copyright © 2015年 yang. All rights reserved.
//

#import "YQStatusCellBottomView.h"
@interface YQStatusCellBottomView ()
@property (nonatomic, strong) UIView *sepView;
@property (nonatomic, strong) UIButton* retweetedBtn;
@property (nonatomic, strong) UIButton* composeBtn;
@property (nonatomic, strong) UIButton* likeBtn;
@end
@implementation YQStatusCellBottomView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
        [self setupUI];
    }
    return self;
}
- (void)setupUI
{
    double scale = 0.4;
    CGFloat w = 0.5;
    [self addSubview:self.retweetedBtn];
    UIView *one = self.sepView;
    [self addSubview:one];
    [self addSubview:self.composeBtn];
    UIView *two = self.sepView;
    [self addSubview:two];
    [self addSubview:self.likeBtn];
    [self.retweetedBtn makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.height.equalTo(self);
        
    }];
    [one makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.retweetedBtn.right);
        make.centerY.equalTo(self);
        make.height.equalTo(self).multipliedBy(scale);
        make.width.equalTo(w);
    }];
    [self.composeBtn makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.retweetedBtn.right);
        make.height.top.equalTo(self);
        make.width.equalTo(self.retweetedBtn);
    }];
    [two makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.composeBtn.right);
        make.centerY.equalTo(self);
        make.height.equalTo(self).multipliedBy(scale);
        make.width.equalTo(w);
    }];
    [self.likeBtn makeConstraints:^(MASConstraintMaker *make) {
        make.height.top.right.equalTo(self);
        make.left.equalTo(self.composeBtn.right);
        make.width.equalTo(self.retweetedBtn);
    }];
}
#pragma mark - 懒加载子控件
-(UIView *)sepView{
    _sepView = [[UIView alloc]init];
    _sepView.backgroundColor = [UIColor darkGrayColor];
    return _sepView;
}
- (UIButton*)retweetedBtn
{
    if (!_retweetedBtn) {

        _retweetedBtn = [[UIButton alloc] initWithTitle:@"转发" backImage:nil color:[UIColor darkGrayColor] image:@"timeline_icon_retweet" size:10];
    }
    return _retweetedBtn;
}
- (UIButton*)composeBtn
{
    if (!_composeBtn) {

        _composeBtn = [[UIButton alloc] initWithTitle:@"评论" backImage:nil color:[UIColor darkGrayColor] image:@"timeline_icon_comment" size:10];
    }
    return _composeBtn;
}
- (UIButton*)likeBtn
{
    if (!_likeBtn) {

        _likeBtn = [[UIButton alloc] initWithTitle:@"赞" backImage:nil color:[UIColor darkGrayColor] image:@"timeline_icon_unlike" size:10];
    }
    return _likeBtn;
}
@end
